# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2Stage do
  @moduledoc """
  Each Stage of the deployment process

  ## Attributes

  *   `message` (*type:* `String.t`, *default:* `nil`) - Message describing the Stage
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the Stage. This will be unique for each Stage.
  *   `resource` (*type:* `String.t`, *default:* `nil`) - Resource of the Stage
  *   `resourceUri` (*type:* `String.t`, *default:* `nil`) - Link to the current Stage resource
  *   `state` (*type:* `String.t`, *default:* `nil`) - Current state of the Stage
  *   `stateMessages` (*type:* `list(GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2StateMessage.t)`, *default:* `nil`) - State messages from the current Stage.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :message => String.t() | nil,
          :name => String.t() | nil,
          :resource => String.t() | nil,
          :resourceUri => String.t() | nil,
          :state => String.t() | nil,
          :stateMessages =>
            list(GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2StateMessage.t()) | nil
        }

  field(:message)
  field(:name)
  field(:resource)
  field(:resourceUri)
  field(:state)

  field(:stateMessages,
    as: GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2StateMessage,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2Stage do
  def decode(value, options) do
    GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2Stage.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudFunctions.V2.Model.GoogleCloudFunctionsV2Stage do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
